home *** CD-ROM | disk | FTP | other *** search
/ Whiteline: Alpha / Whiteline Alpha.iso / progtool / c / gemforce / gfwindws.h < prev    next >
Encoding:
C/C++ Source or Header  |  1994-09-22  |  5.4 KB  |  128 lines

  1. #ifndef __GFWINDOWS__
  2. # define __GFWINDOWS__
  3.  
  4. # include <aes.h>
  5.  
  6. /************************* defines ***********************************/
  7.  
  8. # define NO_HANDLE (-1)                       /* Wert für ungültiges Handle */
  9.  
  10. # define ALL  (NAME|CLOSER|FULLER|MOVER|INFO|SIZER|UPARROW|DNARROW|VSLIDE|LFARROW|RTARROW|HSLIDE)
  11.  
  12. # define MAX_LENGTH  128                         /* max. Länge einer Textzeile */
  13.  
  14. # define CL_TEXT     0x0001                     /* Klasse Textfenster */
  15.  
  16. # define WI_NONE     0x0000                /* Keine Flags */
  17. # define WI_FULLED   0x0001                /* Flag für "Fenster auf voller Größe" */
  18. # define WI_LOCKED   0x0002                /* Flag für "Fenster gelockt" */
  19. # define WI_FIRSTDRW 0x0004                /* Flag für "Fenster erstesmal gezeichnet" */
  20. # define WI_ONTOP    0x0010                /* Flag für "Fenster ist oben" */
  21. # define WI_NOTOP    0x0020                /* Flag für "Fenster darf nicht nach oben */
  22. # define WI_RESIDENT 0x0040                /* Flag für "Fenster resident" */
  23. # define WI_NOSCROLL 0x0100                /* Flag für "Update statt Scrolling */
  24.  
  25. # define DO_CLOSE    6                     /* Code für "Fenster schließen" */
  26. # define DO_DELETE   7                     /* Code für "Fenster löschen" */
  27.  
  28. # define SRCH_CLOSED 0x01                  /* Search-Code für geschlossene Fenster */
  29. # define SRCH_OPENED 0x02                  /* Search-Code für geöffnete Fenster */
  30. # define SRCH_ANY    (SRCH_CLOSED | SRCH_OPENED) /* Search-Code für jedes Fenster */
  31.  
  32. # define MOVED       0x01                  /* Für Verschieben und Vergrößern */
  33. # define SIZED       0x02
  34.  
  35. # define HORIZONTAL  0x01                  /* Für Scrolling... */
  36. # define VERTICAL    0x02                  /* ...und Schieber setzen */
  37. # define SLPOS       0x01                  /* Für Schieber setzen */
  38. # define SLSIZE      0x02
  39.  
  40. /************************* types ***********************************/
  41.  
  42. typedef struct window *WINDOWP;                /* Zeiger für Parameter */
  43.  
  44. typedef struct window
  45. {
  46.     int handle;                                        /* Handle für Fenster */
  47.     BOOLEAN opened;                                /* Fenster geöffnet */
  48.     unsigned int flags;                            /* Flags des Fensters */
  49.     unsigned int kind;                            /* Art des Fensters */
  50.     int class;                                        /* Klasse des Fensters */
  51.     LRECT doc;                                        /* Größe des Dokuments, Position */
  52.     int xfac;                                        /* X-Factor des Dokumentes */
  53.     int yfac;                                        /* Y-Factor des Dokumentes */
  54.     int xunits;                                        /* X-Scroll-Einheiten */
  55.     int yunits;                                        /* Y-Scroll-Einheiten */
  56.     RECT scroll;                                    /* Scrollbereich */
  57.     RECT work;                                        /* Arbeitsbereich */
  58.     long special;                                    /* Für speziellen Gebrauch */
  59.     char name[128];                                /* Name des Fensters */
  60.     char info[128];                                /* Infozeile des Fensters */
  61.     OBJECT *object;                                /* Objektbaum für Fenster */
  62.     BOOLEAN (*test) (WINDOWP, int );            /* Test vor einer Aktion */
  63.     void (*open) (WINDOWP);                        /* Aktion vor dem Öffnen */
  64.     void (*close) (WINDOWP);                    /* Aktion nach dem Schließen */
  65.     void (*delete) (WINDOWP);                    /* Aktion nach dem Löschen */
  66.     void (*draw) (WINDOWP);                        /* Zeichnen-Aktion */
  67.     void (*arrow) (WINDOWP,int,long,long );/* Pfeil-Aktion */
  68.     void (*snap) (WINDOWP, RECT *, int );    /* Schnapp-Aktion */
  69.     void (*top) (WINDOWP);                        /* Aktion nach Top */
  70.     void (*untop) (WINDOWP);                    /* Aktion vor Untop */
  71. } WINDOW;
  72.  
  73. /************************* globals ***********************************/
  74.  
  75. /************************* functions *********************************/
  76.  
  77. GLOBAL BOOLEAN init_windows ( char *, int );
  78. GLOBAL void exit_windows ( void );
  79. GLOBAL BOOLEAN handle_window_events ( int * );
  80. GLOBAL WINDOWP create_textwindow ( char *, int, int, int, RECT * );
  81.  
  82. GLOBAL WINDOWP search_window ( int, int  );
  83. GLOBAL WINDOWP find_window ( int );
  84. GLOBAL WINDOWP find_xy_window ( const int, const int );
  85. GLOBAL WINDOWP find_top ( void );
  86. GLOBAL BOOLEAN is_top ( WINDOWP );
  87. GLOBAL BOOLEAN any_open ( BOOLEAN );
  88. GLOBAL int num_windows ( int, int, WINDOWP [] );
  89. GLOBAL int num_locked ( void );
  90. GLOBAL void lock_all ( WINDOWP );
  91. GLOBAL void unlock_all ( void );
  92.  
  93. GLOBAL WINDOWP create_window ( unsigned int, int );
  94. GLOBAL void delete_window ( WINDOWP );
  95. GLOBAL BOOLEAN open_window ( WINDOWP );
  96. GLOBAL void close_window ( WINDOWP );
  97. GLOBAL void close_top ( void );
  98. GLOBAL void close_all ( BOOLEAN );
  99. GLOBAL void draw_window ( WINDOWP );
  100. GLOBAL void redraw_window ( WINDOWP, const RECT * );
  101. GLOBAL void top_window ( WINDOWP );
  102. GLOBAL void untop_window ( WINDOWP );
  103. GLOBAL void scroll_window ( WINDOWP, int, long );
  104. GLOBAL void arrow_window ( WINDOWP, int, int );
  105. GLOBAL void v_slider ( WINDOWP, int );
  106. GLOBAL void h_slider ( WINDOWP, int );
  107. GLOBAL void set_sliders ( WINDOWP, int, int );
  108. GLOBAL void snap_window ( WINDOWP, RECT *, int );
  109. GLOBAL void full_window ( WINDOWP );
  110. GLOBAL void size_window ( WINDOWP, const RECT * );
  111. GLOBAL void move_window ( WINDOWP, const RECT * );
  112.  
  113. GLOBAL void get_work ( WINDOWP, BOOLEAN );
  114. GLOBAL void get_border ( WINDOWP, int, RECT * );
  115. GLOBAL void draw_object ( WINDOWP, int );
  116.  
  117. GLOBAL void scroll_area ( const RECT *, int, int );
  118. GLOBAL void clr_area ( const RECT * );
  119. GLOBAL void clr_work ( WINDOWP );
  120. GLOBAL void clr_scroll ( WINDOWP );
  121. GLOBAL void clr_left ( WINDOWP );
  122. GLOBAL void clr_right ( WINDOWP );
  123. GLOBAL void clr_top ( WINDOWP );
  124. GLOBAL void clr_bottom ( WINDOWP );
  125. GLOBAL void set_redraw ( WINDOWP, const RECT * );
  126.  
  127. #endif  /* __GFWINDOWS__ */
  128.